package cn.edu.scau.cmi.zengGuanSheng.client;
import cn.edu.scau.cmi.zengGuanSheng.singleton.Chairman;
import javafx.application.Application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.effect.DropShadow;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Line;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
public class TestChairman extends Application {

	@Override
	public void start(Stage primaryStage) throws Exception {
		Group root = new Group();
		Scene scene = new Scene(root,800,500);
		Text t1,t2;
		
		Chairman c1 = Chairman.getInstance("毛泽东");
//		System.out.println(c1.getFlag());
		if(c1.getFlag()==1) {
			t1 = new Text("当前创建的主席对象是毛泽东");
		}else {
			t1 = new Text("创建的主席对象只能是毛泽东,不能是其他对象,且主席对象只有一个:毛泽东");
		}
		
		Chairman c2 = Chairman.getInstance("梁早清");
//		System.out.println(c2.getFlag());
		if(c2.getFlag()==1) {
			t2 = new Text("当前创建的主席对象是毛泽东");
		}else {
			t2 = new Text("创建的主席对象只能是毛泽东,不能是其他对象:梁早清,且主席对象只有一个:毛泽东");
		}
		
		t1.setFont(Font.font ("Verdana", 20));
		t1.setLayoutX(50);
		t1.setLayoutY(250);
		root.getChildren().add(t1);
		
		t2.setFont(Font.font ("Verdana", 20));
		t2.setLayoutX(50);
		t2.setLayoutY(350);
		root.getChildren().add(t2);
		
		primaryStage.setScene(scene);
		primaryStage.setResizable(true);
		primaryStage.show();
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}
